
import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/material.dart';
import 'package:ls_work/res/resources.dart';

import '../util/flat_button.dart';



class MyButton extends StatelessWidget {

  const MyButton({
    Key? key,
    this.text=  "",
    this.onPressed,
  }): super(key: key);

  final String text;
  final VoidCallback? onPressed;

  @override
  Widget build(BuildContext context) {
    return FlatsButton(
      onPressed: (){
        if(onPressed!=null){
          onPressed!();
        }
      },
      color: Colours.app_main,
      //shape:RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
      child: Column(
        children: <Widget>[
          Container(
            height: 48,
            width: double.infinity,
            alignment: Alignment.center,
            child: Text(
              text,
              style: TextStyle(
                  fontSize: Dimens.font_sp18,
                color: Colors.white
              ),
            ),
          ),
        ],
      ),
    );
  }
}
